/*
 Navicat Premium Data Transfer

 Source Server         : openchat.mobi
 Source Server Type    : PostgreSQL
 Source Server Version : 130012
 Source Host           : localhost:5432
 Source Catalog        : privchat
 Source Schema         : public

 Target Server Type    : PostgreSQL
 Target Server Version : 130012
 File Encoding         : 65001

 Date: 13/11/2023 00:45:50
*/


-- ----------------------------
-- Table structure for logic_im_contact
-- ----------------------------
CREATE SEQUENCE public.logic_im_contact_seq
    START WITH 10000
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ALTER TABLE public.logic_im_contact_seq OWNER TO postgres;
SELECT setval('public.logic_im_contact_seq', 10000, false);
DROP TABLE IF EXISTS "public"."logic_im_contact";
CREATE TABLE "public"."logic_im_contact" (
  "id" int4 NOT NULL DEFAULT nextval('logic_im_contact_seq'::regclass),
  "chat_id" int4,
  "user_id" int4,
  "friend_id" int4,
  "created" int4,
  "updated" int4,
  "alias_name" varchar(255) COLLATE "pg_catalog"."default",
  "src" int4
)
;
ALTER TABLE "public"."logic_im_contact" OWNER TO "postgres";

-- ----------------------------
-- Table structure for logic_im_contact_apply
-- ----------------------------
DROP TABLE IF EXISTS "public"."logic_im_contact_apply";
CREATE TABLE "public"."logic_im_contact_apply" (
  "id" int4 NOT NULL,
  "user_id" int4,
  "friend_id" int4,
  "status" int4,
  "created" int4,
  "updated" int4,
  "message" varchar(255) COLLATE "pg_catalog"."default",
  "src" int4
)
;
ALTER TABLE "public"."logic_im_contact_apply" OWNER TO "postgres";
COMMENT ON COLUMN "public"."logic_im_contact_apply"."status" IS '0 undo
1 agree
2 disagree
3 distory';

-- ----------------------------
-- Table structure for logic_im_group
-- ----------------------------
DROP TABLE IF EXISTS "public"."logic_im_group";
CREATE TABLE "public"."logic_im_group" (
  "id" int4 NOT NULL,
  "manager" int4,
  "alias_name" varchar(50) COLLATE "pg_catalog"."default",
  "created" int4,
  "notice" varchar(250) COLLATE "pg_catalog"."default",
  "validation" int4
)
;
ALTER TABLE "public"."logic_im_group" OWNER TO "postgres";

-- ----------------------------
-- Records of logic_im_group
-- ----------------------------
BEGIN;
INSERT INTO "public"."logic_im_group" ("id", "manager", "alias_name", "created", "notice", "validation") VALUES (20221, 70000424, '', 1697467770, '', 0);
INSERT INTO "public"."logic_im_group" ("id", "manager", "alias_name", "created", "notice", "validation") VALUES (20231, 70000424, '', 1697467955, '', 0);
INSERT INTO "public"."logic_im_group" ("id", "manager", "alias_name", "created", "notice", "validation") VALUES (20246, 70000347, '红包群 嗨起来', 1697642470, '', 0);
INSERT INTO "public"."logic_im_group" ("id", "manager", "alias_name", "created", "notice", "validation") VALUES (20247, 70000427, '哈哈哈', 1697700740, '', 0);
COMMIT;

-- ----------------------------
-- Table structure for logic_im_group_apply
-- ----------------------------
CREATE SEQUENCE public.logic_im_group_apply_seq
    START WITH 10000
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ALTER TABLE public.logic_im_group_apply_seq OWNER TO postgres;
SELECT setval('public.logic_im_group_apply_seq', 10000, false);
DROP TABLE IF EXISTS "public"."logic_im_group_apply";
CREATE TABLE "public"."logic_im_group_apply" (
  "id" int4 NOT NULL DEFAULT nextval('logic_im_group_apply_seq'::regclass),
  "group_id" int4,
  "from_id" int4,
  "to_id" int4 NOT NULL,
  "apply_time" int4,
  "alias_name" varchar(50) COLLATE "pg_catalog"."default",
  "new_member" int4 NOT NULL,
  "status" int4
)
;
ALTER TABLE "public"."logic_im_group_apply" OWNER TO "postgres";

-- ----------------------------
-- Records of logic_im_group_apply
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for logic_im_group_user
-- ----------------------------
CREATE SEQUENCE public.logic_im_group_user_seq
    START WITH 10000
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ALTER TABLE public.logic_im_group_user_seq OWNER TO postgres;
SELECT setval('public.logic_im_group_user_seq', 10000, false);
DROP TABLE IF EXISTS "public"."logic_im_group_user";
CREATE TABLE "public"."logic_im_group_user" (
  "id" int4 NOT NULL DEFAULT nextval('logic_im_group_user_seq'::regclass),
  "group_id" int4 NOT NULL,
  "user_id" int4 NOT NULL,
  "nickname" varchar(50) COLLATE "pg_catalog"."default",
  "since" int4 NOT NULL
)
;
ALTER TABLE "public"."logic_im_group_user" OWNER TO "postgres";

-- ----------------------------
-- Table structure for logic_im_history_msg
-- ----------------------------
CREATE SEQUENCE public.logic_im_history_msg_seq
    START WITH 10000
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ALTER TABLE public.logic_im_history_msg_seq OWNER TO postgres;
SELECT setval('public.logic_im_history_msg_seq', 10000, false);
DROP TABLE IF EXISTS "public"."logic_im_history_msg";
CREATE TABLE "public"."logic_im_history_msg" (
  "id" int4 NOT NULL DEFAULT nextval('logic_im_history_msg_seq'::regclass),
  "chat_id" varchar(20) COLLATE "pg_catalog"."default",
  "from_id" varchar(20) COLLATE "pg_catalog"."default",
  "to_id" varchar(20) COLLATE "pg_catalog"."default",
  "message" text COLLATE "pg_catalog"."default",
  "duration" int4,
  "create_time" int4,
  "type" int4,
  "oss_object" varchar(150) COLLATE "pg_catalog"."default",
  "file_size" int4,
  "message_id" varchar(255) COLLATE "pg_catalog"."default",
  "binary_data" text COLLATE "pg_catalog"."default",
  "backoff" int4
)
;
ALTER TABLE "public"."logic_im_history_msg" OWNER TO "postgres";

-- ----------------------------
-- Table structure for logic_im_offline_msg
-- ----------------------------
CREATE SEQUENCE public.logic_im_offline_msg_seq
    START WITH 10000
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ALTER TABLE public.logic_im_offline_msg_seq OWNER TO postgres;
SELECT setval('public.logic_im_offline_msg_seq', 10000, false);
DROP TABLE IF EXISTS "public"."logic_im_offline_msg";
CREATE TABLE "public"."logic_im_offline_msg" (
  "id" int4 NOT NULL DEFAULT nextval('logic_im_offline_msg_seq'::regclass),
  "chat_id" varchar(20) COLLATE "pg_catalog"."default",
  "from_id" varchar(20) COLLATE "pg_catalog"."default",
  "to_id" varchar(20) COLLATE "pg_catalog"."default",
  "message" text COLLATE "pg_catalog"."default",
  "duration" int4,
  "create_time" int4,
  "type" int4,
  "oss_object" varchar(150) COLLATE "pg_catalog"."default",
  "file_size" int4,
  "message_id" varchar(255) COLLATE "pg_catalog"."default",
  "binary_data" text COLLATE "pg_catalog"."default",
  "backoff" int4
)
;
ALTER TABLE "public"."logic_im_offline_msg" OWNER TO "postgres";

-- ----------------------------
-- Table structure for logic_im_red_envelope
-- ----------------------------
CREATE SEQUENCE public.logic_im_red_envelope_seq
    START WITH 10000
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ALTER TABLE public.logic_im_red_envelope_seq OWNER TO postgres;
SELECT setval('public.logic_im_red_envelope_seq', 10000, false);
DROP TABLE IF EXISTS "public"."logic_im_red_envelope";
CREATE TABLE "public"."logic_im_red_envelope" (
  "id" int4 NOT NULL DEFAULT nextval('logic_im_red_envelope_seq'::regclass),
  "type" int4,
  "fromId" int4,
  "amount" int8,
  "number" int4,
  "status" int2,
  "created" int4,
  "chatId" int8,
  "taget_type" int4,
  "message" text COLLATE "pg_catalog"."default",
  "messageId" text COLLATE "pg_catalog"."default"
)
;
ALTER TABLE "public"."logic_im_red_envelope" OWNER TO "postgres";

-- ----------------------------
-- Table structure for logic_im_red_envelope_record
-- ----------------------------
CREATE SEQUENCE public.logic_im_red_envelope_record_seq
    START WITH 10000
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ALTER TABLE public.logic_im_red_envelope_record_seq OWNER TO postgres;
SELECT setval('public.logic_im_red_envelope_record_seq', 10000, false);
DROP TABLE IF EXISTS "public"."logic_im_red_envelope_record";
CREATE TABLE "public"."logic_im_red_envelope_record" (
  "id" int4 NOT NULL DEFAULT nextval('logic_im_red_envelope_record_seq'::regclass),
  "envelope_id" int4,
  "dynamic" int4,
  "created" int4,
  "chat_id" int8,
  "user_id" int4,
  "from_id" int4
)
;
ALTER TABLE "public"."logic_im_red_envelope_record" OWNER TO "postgres";


-- ----------------------------
-- Table structure for logic_im_red_envelope_split
-- ----------------------------
CREATE SEQUENCE public.logic_im_red_envelope_split_seq
    START WITH 10000
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ALTER TABLE public.logic_im_red_envelope_split_seq OWNER TO postgres;
SELECT setval('public.logic_im_red_envelope_split_seq', 10000, false);
DROP TABLE IF EXISTS "public"."logic_im_red_envelope_split";
CREATE TABLE "public"."logic_im_red_envelope_split" (
  "id" int4 NOT NULL DEFAULT nextval('logic_im_red_envelope_split_seq'::regclass),
  "envelope_id" int4,
  "amount" int4,
  "created" int4,
  "chat_id" int8,
  "from_id" int4
)
;
ALTER TABLE "public"."logic_im_red_envelope_split" OWNER TO "postgres";

-- ----------------------------
-- Table structure for logic_im_system_config
-- ----------------------------
DROP TABLE IF EXISTS "public"."logic_im_system_config";
CREATE TABLE "public"."logic_im_system_config" (
  "key" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "value" varchar(255) COLLATE "pg_catalog"."default"
)
;
ALTER TABLE "public"."logic_im_system_config" OWNER TO "postgres";

-- ----------------------------
-- Records of logic_im_system_config
-- ----------------------------
BEGIN;
INSERT INTO "public"."logic_im_system_config" ("key", "value") VALUES ('oss-access-key', 'LTAI4G8bhicZ3G94JLW2eEhC');
INSERT INTO "public"."logic_im_system_config" ("key", "value") VALUES ('oss-access-secret', 'mlmWUrfzqA4hJNWtXPBHKtOfrrS0xP');
INSERT INTO "public"."logic_im_system_config" ("key", "value") VALUES ('oss-bucketname', 'putao-im-test');
INSERT INTO "public"."logic_im_system_config" ("key", "value") VALUES ('oss-endpoint', 'oss-cn-shanghai.aliyuncs.com');
INSERT INTO "public"."logic_im_system_config" ("key", "value") VALUES ('next-dbid', '20270');
COMMIT;

-- ----------------------------
-- Table structure for logic_im_user
-- ----------------------------
DROP TABLE IF EXISTS "public"."logic_im_user";
CREATE TABLE "public"."logic_im_user" (
  "id" int4 NOT NULL,
  "mobile" varchar(50) COLLATE "pg_catalog"."default",
  "nickname" varchar(50) COLLATE "pg_catalog"."default",
  "avatar" varchar(1024) COLLATE "pg_catalog"."default",
  "gender" int4,
  "birthday" varchar(50) COLLATE "pg_catalog"."default",
  "created" int4,
  "updated" int4,
  "status" int4,
  "add_validation" int4,
  "qrcode_id" varchar(255) COLLATE "pg_catalog"."default",
  "username" varchar(255) COLLATE "pg_catalog"."default",
  "device_id_android" varchar(128) COLLATE "pg_catalog"."default",
  "device_id_ios" varchar(128) COLLATE "pg_catalog"."default",
  "unread" int4
)
;
ALTER TABLE "public"."logic_im_user" OWNER TO "postgres";

-- ----------------------------
-- Table structure for logic_im_user_assets
-- ----------------------------
DROP TABLE IF EXISTS "public"."logic_im_user_assets";
CREATE TABLE "public"."logic_im_user_assets" (
  "id" int8 NOT NULL,
  "assets" int8,
  "bankcard" varchar(32) COLLATE "pg_catalog"."default",
  "id_card" varchar(32) COLLATE "pg_catalog"."default"
)
;
ALTER TABLE "public"."logic_im_user_assets" OWNER TO "postgres";

-- ----------------------------
-- Table structure for logic_im_user_device_token
-- ----------------------------
DROP TABLE IF EXISTS "public"."logic_im_user_device_token";
CREATE TABLE "public"."logic_im_user_device_token" (
  "id" int4 NOT NULL,
  "userId" int4,
  "token" text COLLATE "pg_catalog"."default"
)
;
ALTER TABLE "public"."logic_im_user_device_token" OWNER TO "postgres";

-- ----------------------------
-- Records of logic_im_user_device_token
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for logic_system_admin
-- ----------------------------
CREATE SEQUENCE public.system_admin_id_seq
    START WITH 10000
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ALTER TABLE public.system_admin_id_seq OWNER TO postgres;
SELECT setval('public.system_admin_id_seq', 10000, false);
DROP TABLE IF EXISTS "public"."logic_system_admin";
CREATE TABLE "public"."logic_system_admin" (
  "id" int8 NOT NULL DEFAULT nextval('system_admin_id_seq'::regclass),
  "email" varchar(64) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "password" varchar(64) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "salt" varchar(64) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "name" varchar(64) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "avatar" varchar(255) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "created" int8 NOT NULL DEFAULT 0,
  "updated" int8 NOT NULL DEFAULT 0,
  "status" int2 NOT NULL DEFAULT 0,
  "supered" int2,
  "language" varchar(50) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
  "username" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "mobile" varchar(64) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "admin_id" int8 NOT NULL,
  "ip" varchar(32) COLLATE "pg_catalog"."default"
)
;
ALTER TABLE "public"."logic_system_admin" OWNER TO "postgres";
COMMENT ON COLUMN "public"."logic_system_admin"."admin_id" IS '创建的管理员';
COMMENT ON COLUMN "public"."logic_system_admin"."ip" IS '创建账号时的IP';

-- ----------------------------
-- Records of logic_system_admin
-- ----------------------------
BEGIN;
INSERT INTO "public"."logic_system_admin" ("id", "email", "password", "salt", "name", "avatar", "created", "updated", "status", "supered", "language", "username", "mobile", "admin_id", "ip") VALUES (1, 'admin@putao.com', '94033bcc4da699d5f86ed41ea40e563d', 'abcdfe', '管理员', 'https://file-oss.putaocdn.com/video/5d536cd9a28401e65387dd6aac31f29b9b68dbcf.jpg', 1, 1596559053, 1, 1, NULL, 'admin', '18516693469', 1, NULL);
COMMIT;

-- ----------------------------
-- Table structure for logic_system_admin_role
-- ----------------------------
DROP TABLE IF EXISTS "public"."logic_system_admin_role";
CREATE TABLE "public"."logic_system_admin_role" (
  "admin_id" int8 NOT NULL,
  "role_id" int8 NOT NULL,
  "created" int8 NOT NULL
)
;
ALTER TABLE "public"."logic_system_admin_role" OWNER TO "postgres";

-- ----------------------------
-- Records of logic_system_admin_role
-- ----------------------------
BEGIN;
INSERT INTO "public"."logic_system_admin_role" ("admin_id", "role_id", "created") VALUES (1, 3, 1596554220);
INSERT INTO "public"."logic_system_admin_role" ("admin_id", "role_id", "created") VALUES (1, 1, 1596554220);
COMMIT;

-- ----------------------------
-- Table structure for logic_system_file_info
-- ----------------------------
CREATE SEQUENCE public.system_file_info_id_seq
    START WITH 10000
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ALTER TABLE public.system_file_info_id_seq OWNER TO postgres;
SELECT setval('public.system_file_info_id_seq', 10000, false);
DROP TABLE IF EXISTS "public"."logic_system_file_info";
CREATE TABLE "public"."logic_system_file_info" (
  "id" int8 NOT NULL DEFAULT nextval('system_file_info_id_seq'::regclass),
  "admin_id" int8 NOT NULL,
  "originname" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "rename" varchar(200) COLLATE "pg_catalog"."default",
  "sha1" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "ext" varchar(255) COLLATE "pg_catalog"."default",
  "url" varchar(512) COLLATE "pg_catalog"."default",
  "type" varchar(100) COLLATE "pg_catalog"."default",
  "size" int8,
  "created" int4,
  "updated" int4
)
;
ALTER TABLE "public"."logic_system_file_info" OWNER TO "postgres";

-- ----------------------------
-- Table structure for logic_system_log
-- ----------------------------
CREATE SEQUENCE public.system_log_id_seq
    START WITH 10000
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ALTER TABLE public.system_log_id_seq OWNER TO postgres;
SELECT setval('public.system_log_id_seq', 10000, false);
DROP TABLE IF EXISTS "public"."logic_system_log";
CREATE TABLE "public"."logic_system_log" (
  "id" int8 NOT NULL DEFAULT nextval('system_log_id_seq'::regclass),
  "admin_id" int8 NOT NULL,
  "method" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "path" varchar(64) COLLATE "pg_catalog"."default",
  "request_query" varchar(255) COLLATE "pg_catalog"."default",
  "request_body" text COLLATE "pg_catalog"."default",
  "ip" varchar(64) COLLATE "pg_catalog"."default",
  "request_time" int8,
  "created" int8
)
;
ALTER TABLE "public"."logic_system_log" OWNER TO "postgres";
COMMENT ON COLUMN "public"."logic_system_log"."method" IS '提交方式：get post等';
COMMENT ON COLUMN "public"."logic_system_log"."path" IS '路径';
COMMENT ON COLUMN "public"."logic_system_log"."request_query" IS '请求GET参数';
COMMENT ON COLUMN "public"."logic_system_log"."request_body" IS '请求内容';
COMMENT ON COLUMN "public"."logic_system_log"."request_time" IS '请求时间';
COMMENT ON COLUMN "public"."logic_system_log"."created" IS '创建时间';

-- ----------------------------
-- Table structure for logic_system_permission
-- ----------------------------
CREATE SEQUENCE public.system_permission_id_seq
    START WITH 10000
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ALTER TABLE public.system_permission_id_seq OWNER TO postgres;
SELECT setval('public.system_permission_id_seq', 10000, false);
DROP TABLE IF EXISTS "public"."logic_system_permission";
CREATE TABLE "public"."logic_system_permission" (
  "id" int8 NOT NULL DEFAULT nextval('system_permission_id_seq'::regclass),
  "pid" int8 NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default" NOT NULL DEFAULT ''::character varying,
  "actionid" varchar(128) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
  "icon" varchar(255) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
  "type" int2 NOT NULL,
  "path" varchar(255) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
  "sort" int8 DEFAULT 0,
  "created" int8 NOT NULL,
  "updated" int8 NOT NULL DEFAULT 0,
  "status" int2 NOT NULL DEFAULT 0
)
;
ALTER TABLE "public"."logic_system_permission" OWNER TO "postgres";
COMMENT ON COLUMN "public"."logic_system_permission"."pid" IS '父级菜单，顶级菜单默认0';
COMMENT ON COLUMN "public"."logic_system_permission"."name" IS '菜单名';
COMMENT ON COLUMN "public"."logic_system_permission"."actionid" IS '权限路由标识';
COMMENT ON COLUMN "public"."logic_system_permission"."icon" IS '菜单图标样式';
COMMENT ON COLUMN "public"."logic_system_permission"."type" IS '1顶菜单2左菜单3按钮';
COMMENT ON COLUMN "public"."logic_system_permission"."path" IS '路径';
COMMENT ON COLUMN "public"."logic_system_permission"."sort" IS '正序排列，0排最后';
COMMENT ON COLUMN "public"."logic_system_permission"."status" IS '0关1开';

-- ----------------------------
-- Records of logic_system_permission
-- ----------------------------
BEGIN;
INSERT INTO "public"."logic_system_permission" ("id", "pid", "name", "actionid", "icon", "type", "path", "sort", "created", "updated", "status") VALUES (22, 2, '添加菜单', 'system.permission.add', '1', 3, '', 1, 1596107659, 1596107659, 1);
INSERT INTO "public"."logic_system_permission" ("id", "pid", "name", "actionid", "icon", "type", "path", "sort", "created", "updated", "status") VALUES (24, 2, '修改菜单', 'system.permission.edit', '1', 3, '', 1, 1596107659, 1596107659, 1);
INSERT INTO "public"."logic_system_permission" ("id", "pid", "name", "actionid", "icon", "type", "path", "sort", "created", "updated", "status") VALUES (35, 6, '角色删除', 'system.role.del', '1', 3, '', 1, 1, 1, 1);
INSERT INTO "public"."logic_system_permission" ("id", "pid", "name", "actionid", "icon", "type", "path", "sort", "created", "updated", "status") VALUES (29, 6, '角色添加', 'system.role.add', '1', 3, '', 1, 1596107659, 1596107659, 1);
INSERT INTO "public"."logic_system_permission" ("id", "pid", "name", "actionid", "icon", "type", "path", "sort", "created", "updated", "status") VALUES (25, 2, '删除菜单', 'system.permission.del', '', 3, '', 1, 1596107659, 1596107659, 1);
INSERT INTO "public"."logic_system_permission" ("id", "pid", "name", "actionid", "icon", "type", "path", "sort", "created", "updated", "status") VALUES (6, 1, '角色管理', 'system.role.list', '1', 2, '', 1, 1596107659, 1596107659, 1);
INSERT INTO "public"."logic_system_permission" ("id", "pid", "name", "actionid", "icon", "type", "path", "sort", "created", "updated", "status") VALUES (8, 1, '日志管理', 'system.log.list', '1', 2, '', 1, 1596107659, 1596107659, 0);
INSERT INTO "public"."logic_system_permission" ("id", "pid", "name", "actionid", "icon", "type", "path", "sort", "created", "updated", "status") VALUES (2, 1, '菜单管理', 'system.permission.list', '1', 2, '', 1, 1596107659, 1596107659, 1);
INSERT INTO "public"."logic_system_permission" ("id", "pid", "name", "actionid", "icon", "type", "path", "sort", "created", "updated", "status") VALUES (37, 7, '用户添加', 'system.admin.add', '1', 3, '', 1, 1, 1, 1);
INSERT INTO "public"."logic_system_permission" ("id", "pid", "name", "actionid", "icon", "type", "path", "sort", "created", "updated", "status") VALUES (38, 7, '用户修改', 'system.admin.edit', '1', 3, '', 1, 1, 1, 1);
INSERT INTO "public"."logic_system_permission" ("id", "pid", "name", "actionid", "icon", "type", "path", "sort", "created", "updated", "status") VALUES (39, 7, '用户删除', 'system.admin.del', '1', 3, '', 1, 1, 1, 1);
INSERT INTO "public"."logic_system_permission" ("id", "pid", "name", "actionid", "icon", "type", "path", "sort", "created", "updated", "status") VALUES (7, 1, '用户管理', 'system.admin.list', '1', 2, '', 1, 1596107659, 1596107659, 1);
INSERT INTO "public"."logic_system_permission" ("id", "pid", "name", "actionid", "icon", "type", "path", "sort", "created", "updated", "status") VALUES (40, 7, '用户重置密码', 'system.admin.resetpassword', '1', 3, '', 1, 1, 1, 1);
INSERT INTO "public"."logic_system_permission" ("id", "pid", "name", "actionid", "icon", "type", "path", "sort", "created", "updated", "status") VALUES (1, 0, '系统管理', '', '1', 2, '', 3, 1596107659, 1596107659, 1);
INSERT INTO "public"."logic_system_permission" ("id", "pid", "name", "actionid", "icon", "type", "path", "sort", "created", "updated", "status") VALUES (30, 6, '角色修改', 'system.role.edit', '1', 3, '', 1, 0, 1597225587, 1);
INSERT INTO "public"."logic_system_permission" ("id", "pid", "name", "actionid", "icon", "type", "path", "sort", "created", "updated", "status") VALUES (3, 0, '活动设置', '', '1', 2, '', 2, 0, 1598084173, 1);
INSERT INTO "public"."logic_system_permission" ("id", "pid", "name", "actionid", "icon", "type", "path", "sort", "created", "updated", "status") VALUES (26, 0, '系统菜单', '123', '0924', 3, '0924', 1, 1600927935, 0, 0);
COMMIT;

-- ----------------------------
-- Table structure for logic_system_role
-- ----------------------------
CREATE SEQUENCE public.system_role_id_seq
    START WITH 10000
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;
ALTER TABLE public.system_role_id_seq OWNER TO postgres;
SELECT setval('public.system_role_id_seq', 10000, false);
DROP TABLE IF EXISTS "public"."logic_system_role";
CREATE TABLE "public"."logic_system_role" (
  "id" int8 NOT NULL DEFAULT nextval('system_role_id_seq'::regclass),
  "name" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  "created" int8 NOT NULL DEFAULT 0,
  "updated" int8 NOT NULL DEFAULT 0,
  "status" int2 NOT NULL DEFAULT 0,
  "identity" varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
  "intro" varchar(512) COLLATE "pg_catalog"."default" DEFAULT ''::character varying
)
;
ALTER TABLE "public"."logic_system_role" OWNER TO "postgres";
COMMENT ON COLUMN "public"."logic_system_role"."identity" IS '角色唯一标识';
COMMENT ON COLUMN "public"."logic_system_role"."intro" IS '角色描述介绍';

-- ----------------------------
-- Records of logic_system_role
-- ----------------------------
BEGIN;
INSERT INTO "public"."logic_system_role" ("id", "name", "created", "updated", "status", "identity", "intro") VALUES (3, '技术员', 0, 1597738840, 1, 'TEC', '');
INSERT INTO "public"."logic_system_role" ("id", "name", "created", "updated", "status", "identity", "intro") VALUES (1, '管理员', 0, 1598342175, 1, 'ADMIN', '管理所有菜单的超级管理员');
INSERT INTO "public"."logic_system_role" ("id", "name", "created", "updated", "status", "identity", "intro") VALUES (2, '测试员', 1600927826, 0, 1, 'ANN', '2213');
COMMIT;

-- ----------------------------
-- Table structure for logic_system_role_permission
-- ----------------------------
DROP TABLE IF EXISTS "public"."logic_system_role_permission";
CREATE TABLE "public"."logic_system_role_permission" (
  "role_id" int8 NOT NULL,
  "permission_id" int8 NOT NULL,
  "created" int8 NOT NULL
)
;
ALTER TABLE "public"."logic_system_role_permission" OWNER TO "postgres";

-- ----------------------------
-- Records of logic_system_role_permission
-- ----------------------------
BEGIN;
INSERT INTO "public"."logic_system_role_permission" ("role_id", "permission_id", "created") VALUES (2, 22, 1600927826);
INSERT INTO "public"."logic_system_role_permission" ("role_id", "permission_id", "created") VALUES (2, 24, 1600927826);
INSERT INTO "public"."logic_system_role_permission" ("role_id", "permission_id", "created") VALUES (1, 22, 1598342175);
INSERT INTO "public"."logic_system_role_permission" ("role_id", "permission_id", "created") VALUES (1, 24, 1598342175);
INSERT INTO "public"."logic_system_role_permission" ("role_id", "permission_id", "created") VALUES (1, 35, 1598342175);
INSERT INTO "public"."logic_system_role_permission" ("role_id", "permission_id", "created") VALUES (1, 29, 1598342175);
INSERT INTO "public"."logic_system_role_permission" ("role_id", "permission_id", "created") VALUES (1, 25, 1598342175);
INSERT INTO "public"."logic_system_role_permission" ("role_id", "permission_id", "created") VALUES (1, 6, 1598342175);
INSERT INTO "public"."logic_system_role_permission" ("role_id", "permission_id", "created") VALUES (1, 8, 1598342175);
INSERT INTO "public"."logic_system_role_permission" ("role_id", "permission_id", "created") VALUES (1, 2, 1598342175);
INSERT INTO "public"."logic_system_role_permission" ("role_id", "permission_id", "created") VALUES (1, 37, 1598342175);
INSERT INTO "public"."logic_system_role_permission" ("role_id", "permission_id", "created") VALUES (1, 38, 1598342175);
INSERT INTO "public"."logic_system_role_permission" ("role_id", "permission_id", "created") VALUES (1, 39, 1598342175);
INSERT INTO "public"."logic_system_role_permission" ("role_id", "permission_id", "created") VALUES (1, 7, 1598342175);
INSERT INTO "public"."logic_system_role_permission" ("role_id", "permission_id", "created") VALUES (1, 40, 1598342175);
INSERT INTO "public"."logic_system_role_permission" ("role_id", "permission_id", "created") VALUES (1, 1, 1598342175);
INSERT INTO "public"."logic_system_role_permission" ("role_id", "permission_id", "created") VALUES (1, 30, 1598342175);
INSERT INTO "public"."logic_system_role_permission" ("role_id", "permission_id", "created") VALUES (1, 3, 1598342175);
COMMIT;

-- ----------------------------
-- Indexes structure for table logic_im_contact
-- ----------------------------
CREATE INDEX "sid" ON "public"."logic_im_contact" USING btree (
  "chat_id" "pg_catalog"."int4_ops" ASC NULLS LAST
);
CREATE INDEX "uid" ON "public"."logic_im_contact" USING btree (
  "user_id" "pg_catalog"."int4_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table logic_im_contact
-- ----------------------------
ALTER TABLE "public"."logic_im_contact" ADD CONSTRAINT "friend_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table logic_im_group_apply
-- ----------------------------
ALTER TABLE "public"."logic_im_group_apply" ADD CONSTRAINT "logic_im_group_apply_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table logic_im_group_user
-- ----------------------------
ALTER TABLE "public"."logic_im_group_user" ADD CONSTRAINT "logic_im_group_user_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table logic_im_history_msg
-- ----------------------------
ALTER TABLE "public"."logic_im_history_msg" ADD CONSTRAINT "logic_im_history_msg_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table logic_im_offline_msg
-- ----------------------------
ALTER TABLE "public"."logic_im_offline_msg" ADD CONSTRAINT "logic_im_offline_msg_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table logic_im_red_envelope
-- ----------------------------
ALTER TABLE "public"."logic_im_red_envelope" ADD CONSTRAINT "logic_im_red_envelope_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table logic_im_red_envelope_record
-- ----------------------------
ALTER TABLE "public"."logic_im_red_envelope_record" ADD CONSTRAINT "logic_im_red_envelope_record_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table logic_im_red_envelope_split
-- ----------------------------
ALTER TABLE "public"."logic_im_red_envelope_split" ADD CONSTRAINT "logic_im_red_envelope_split_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table logic_im_user_assets
-- ----------------------------
ALTER TABLE "public"."logic_im_user_assets" ADD CONSTRAINT "logic_im_user_assets_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table logic_im_user_device_token
-- ----------------------------
ALTER TABLE "public"."logic_im_user_device_token" ADD CONSTRAINT "logic_im_user_device_token_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Uniques structure for table logic_system_admin
-- ----------------------------
ALTER TABLE "public"."logic_system_admin" ADD CONSTRAINT "system_admin_id_key" UNIQUE ("id");
ALTER TABLE "public"."logic_system_admin" ADD CONSTRAINT "system_user_username_key" UNIQUE ("username");

-- ----------------------------
-- Primary Key structure for table logic_system_admin
-- ----------------------------
ALTER TABLE "public"."logic_system_admin" ADD CONSTRAINT "system_admin_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table logic_system_log
-- ----------------------------
ALTER TABLE "public"."logic_system_log" ADD CONSTRAINT "system_log_pkey" PRIMARY KEY ("id", "admin_id");

-- ----------------------------
-- Uniques structure for table logic_system_permission
-- ----------------------------
ALTER TABLE "public"."logic_system_permission" ADD CONSTRAINT "system_permission_id_key" UNIQUE ("id");

-- ----------------------------
-- Primary Key structure for table logic_system_permission
-- ----------------------------
ALTER TABLE "public"."logic_system_permission" ADD CONSTRAINT "system_menu_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table logic_system_role
-- ----------------------------
CREATE UNIQUE INDEX "system_role_identity_idx" ON "public"."logic_system_role" USING btree (
  "identity" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Uniques structure for table logic_system_role
-- ----------------------------
ALTER TABLE "public"."logic_system_role" ADD CONSTRAINT "system_role_id_key" UNIQUE ("id");

-- ----------------------------
-- Primary Key structure for table logic_system_role
-- ----------------------------
ALTER TABLE "public"."logic_system_role" ADD CONSTRAINT "system_role_pkey" PRIMARY KEY ("id", "identity");

-- ----------------------------
-- Foreign Keys structure for table logic_system_role_permission
-- ----------------------------
ALTER TABLE "public"."logic_system_role_permission" ADD CONSTRAINT "system_role_permission_permission_id_fkey" FOREIGN KEY ("permission_id") REFERENCES "public"."logic_system_permission" ("id") ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE "public"."logic_system_role_permission" ADD CONSTRAINT "system_role_permission_role_id_fkey" FOREIGN KEY ("role_id") REFERENCES "public"."logic_system_role" ("id") ON DELETE CASCADE ON UPDATE CASCADE;
